<template>
  <div class="header">
    <div class="left">
      <h3><span></span>{{ title }}</h3>
    </div>
    <div class="right">
      <el-button type="primary" class="add" @click="add" v-if="!flag">新增</el-button>
      <el-button type="warning" @click="del" v-if="!flag">批量删除</el-button>
    </div>
  </div>
</template>
<script lang="ts">
export default {
  props: ["title","flag"],
  emits: ["del", "add"],
  setup(props, { emit }) {
    var del = () => emit("del");
    var add = () => emit("add");
    return {
      del,
      add,
    };
  },
};
</script>
<style scoped lang="scss">
.header {
  display: flex;
  justify-content: space-between;
  height: 60px;
  background: #fff;
  align-items: center;
  padding: 0 10px;
  padding-right: 20px;
  margin-bottom: 10px;
  h3 {
    display: flex;
    height: 100%;
    margin-left: 30px;
    font-weight: 600;
    span {
      width: 8px;
      flex: 1;
      background: rgb(94, 128, 234);
      margin-right: 15px;
    }
  }
  .right {
    .add {
      margin-right: 20px;
    }
  }
}
</style>
